<!doctype html>
<html class="no-js" lang="zxx">
<head th:include="/yyyh/include :: header"></head>
<style>
	.register .register-left {
		background-image: url(/img/yyyh/signup-bg.jpg);
		background-size: cover;
		background-position: center center;
		background-repeat: no-repeat;
		width: 100%;
		height: 100%;
	}
</style>
    <body>
	
		<!-- Preloader -->
        <div class="preloader">
            <div class="loader">
                <div class="loader-outter"></div>
                <div class="loader-inner"></div>

                <div class="indicator"> 
                    <svg width="16px" height="12px">
                        <polyline id="back" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
                        <polyline id="front" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
                    </svg>
                </div>
            </div>
        </div>
        <!-- End Preloader -->


		<!-- Header Area -->
		<header th:replace="/yyyh/include :: bodyHeader"></header>
		<!-- End Header Area -->
	
		<!-- Breadcrumbs -->
		<div class="breadcrumbs overlay">
			<div class="container">
				<div class="bread-inner">
					<div class="row">
						<div class="col-12">
							<h2>注册</h2>
							<ul class="bread-list">
								<li><a href="/yyyh">主页</a></li>
								<li><i class="icofont-simple-right"></i></li>
								<li class="active">注册</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- End Breadcrumbs -->
				
		<!-- Shop Register -->
		<section class="register section">
			<div class="container">
				<div class="inner">
					<div class="row"> 
						<div class="col-lg-6">
							<div class="register-left">
							
							</div>
						</div>
						<div class="col-lg-6">
							<div class="register-form">
								<h2>注册</h2>
								<p>已经拥有账户？<a href="/login">登录</a></p>
								<!-- Form -->
								<form class="form" id="signupForm" method="post" action="#">
									<div class="row">
										<div class="col-lg-12">
											<div class="form-group">
												<label class="col-sm-3 control-label">姓名：</label>
												<div class="col-sm-12">
													<input id="name" name="name" class="form-control" type="text" required="">
												</div>
											</div>
										</div>

										<div class="col-lg-12">
											<div class="form-group">
												<label class="col-sm-3 control-label">用户名：</label>
												<div class="col-sm-12">
													<input id="username" name="username" class="form-control"
														   type="text">
												</div>
											</div>
										</div>
										<div class="col-lg-12">
											<div class="form-group">
												<label class="col-sm-3 control-label">密码：</label>
												<div class="col-sm-12">
													<input id="password" name="password" class="form-control"
														   type="password" required="">
												</div>
											</div>
										</div>
										<input type="hidden" name="status" value="1" />
										<input name="roleIds" type="hidden" value="59">

										<div class="col-12">
											<div class="form-group login-btn">
												<button class="btn" type="button" onclick="save()">注册</button>
											</div>
										</div>
									</div>
								</form>
								<!--/ End Form -->
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<!--/ End Register -->

		<div th:replace="/yyyh/include :: bodyFooter"></div>

		<script src="/js/plugins/layer/layer.js"></script>
	<script>
		function save() {
			$.ajax({
				cache : true,
				type : "POST",
				url : "/sys/user/save",
				data : $('#signupForm').serialize(),// 你的formid
				async : false,
				error : function(request) {
					layer.alert("Connection error");
				},
				success : function(data) {
					if (data.code == 0) {
						layer.msg("注册成功");
						location.href='/login'
					} else {
						layer.alert(data.msg)
					}

				}
			});

		}
	</script>
    </body>
</html>